﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Ymatou.ServiceCenter
{
    /// <summary>
    /// 服务元数据
    /// </summary>
    public class ServiceMetadata
    {
        /// <summary>
        /// 应用编号
        /// </summary>
        public string AppId { get; set; }
        /// <summary>
        /// 接口名称
        /// </summary>
        public string ApiName { get; set; }
        /// <summary>
        /// 域名
        /// </summary>
        public string Host { get; set; }
        /// <summary>
        /// 接口地址
        /// </summary>
        public string ApiPath { get; set; }
        /// <summary>
        /// http方法
        /// </summary>
        public string HttpMethod { get; set; }

        /// <summary>
        /// 接口的用途描述
        /// </summary>
        public string Description { get; set; }

        /// <summary>
        /// 接口的拥有者
        /// </summary>
        public string Owner { get; set; }

        /// <summary>
        /// 最后一次更新时间
        /// </summary>
        public DateTime LastUpdateTime { get; set; }
        /// <summary>
        /// 最后一次更新时间刻度，用来做与服务器端的数据同步
        /// </summary>
        public long LastUpdateTicks { get; set; }

        public override string ToString()
        {
            return string.Format("AppId:{0},ApiName:{1},Host:{2},ApiPath:{3},HttpMethod:{4},Description:{5},Owner:{6},LastUpdateTime:{7},LastUpdateTicks:{8}",
                AppId, ApiName, Host, ApiPath, HttpMethod, Description, Owner, LastUpdateTime, LastUpdateTicks);
        }
    }
}
